#include <iostream>

const int size = 10;
class ArrayQueue
{
public:
    ArrayQueue() : front(0), rear(0) {}

    // 入队列
    void Push(int data)
    {
        if ((rear + 1) % size == front)
        {
            std::cout << "队列满\n";
            return;
        }
        queue[rear++] = data;
        rear %= size;
    }

    // 出队列
    void Pop()
    {
        if (front == rear)
        {
            std::cout << "队列空\n";
            return;
        }
        front++;
        front %= size;
    }

    int *GetFront()
    {
        return &queue[front];
    }

    bool IsEmpty()
    {
        return front == rear;
    }

private:
    int queue[size];
    int front;
    int rear;
};

int main()
{
    ArrayQueue q;
    for (int i = 0; i < 19; i++)
        q.Push(i + 1);

    while (!q.IsEmpty())
    {
        std::cout << *q.GetFront() << " ";
        q.Pop();
    }
    std::cout << std::endl;

    return 0;
}
